package com.flashcash.solu.view;

import android.view.View;
import android.widget.TextView;

import com.flashcash.kotlin.utils.FirebaseAnalyticsConstants;
import com.flashcash.kotlin.utils.FirebaseAnalyticsUtils;
import com.flashcash.kotlin.widget.LocalButton;
import com.flashcash.solu.R;
import com.flashcash.solu.app.base.BaseActivity;
import com.flashcash.solu.common.EventCollection;
import com.hwangjr.rxbus.RxBus;

public class SubmittedLoanActivity extends BaseActivity<SubmittedActPreImp> {

    private LocalButton previewMyLoan;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_submitted_loan;
    }

    @Override
    protected void init() {
        previewMyLoan = findViewById(R.id.btn_review_my_loan);
        previewMyLoan.setOnClickListener(v -> {
            FirebaseAnalyticsUtils.INSTANCE.logEvent(FirebaseAnalyticsConstants.Event.REVIEW_MY_LOAN, null);
            RxBus.get().post(new EventCollection.GotoMyLoan());
            finish();
        });
        findViewById(R.id.id_imagebutton_back).setOnClickListener(v -> {
            RxBus.get().post(new EventCollection.GotoMyLoan());
            finish();
        });
        findViewById(R.id.id_imagebutton_info_list).setVisibility(View.INVISIBLE);
        TextView tv = findViewById(R.id.id_textview_title);
        tv.setText("");
    }

    @Override
    protected void onResume() {
        super.onResume();
        FirebaseAnalyticsUtils.INSTANCE.logEvent(FirebaseAnalyticsConstants.Event.EXPOSURE_SUBMITTED_LOAN, null);
    }

    @Override
    protected SubmittedActPreImp initPresenterImpl() {
        return new SubmittedActPreImp();
    }
}
